<template>
  <footer v-if="total>pagesizes[0]" class="vpage-footer"
    :style="isPublic?{position:'fixed','text-align':'center','z-index':'999',background:'#fff',bottom:'15px',left:$store.getters.collapsed?'88px':'244px',right:'30px',height:'45px'}:''">
    <!--  v-if="total>pagesizes[0]" -->
    <el-pagination background :current-page="currentpage" :page-sizes="pagesizes" :page-size="pagesize"
      layout=" total, sizes, prev, pager, next, jumper" :total="total" @size-change="handleSizeChange"
      @current-change="handleCurrentChange" />
  </footer>
</template>

<script>
export default {
  // eslint-disable-next-line vue/require-prop-types
  props: ['pagesize', 'pagesizes', 'total', 'currentpage', 'isPublic'],
  // props: {
  //   "page-size": {
  //     type: Number,
  //     default: 10
  //   },
  //   "page-sizes": {},
  //   total: {
  //     type: Number,
  //     default: 0
  //   },
  //   "current-page": [Number, String]
  // },

  data() {
    return {}
  },
  methods: {
    // 控制每页数据大小
    // handleSizeChange(val) {
    //   this.pagesize = val;
    //   //   this.initDataList();
    //   console.log(`每页 ${val} 条`);
    // },
    // //控制当前页数据
    // handleCurrentChange(val) {
    //   this.currentpage = val;
    //   //   this.initDataList();
    //   console.log(`当前页: ${val}`);
    // }
    // handleSizeChange() {
    //   this.$emit.handleSizeChange;
    // },
    // handleCurrentChange() {
    //   this.emit.handleCurrentChange;
    // },
    handleSizeChange(val) {
      // 事件传递
      this.$emit('sizechange', val)
    },
    // 当前页
    handleCurrentChange(val) {
      // 事件传递
      this.$emit('currentchange', val)
    }
  }
}
</script>
<style lang="scss" scoped>
.vpage-footer {
  display: block;
  background-color: #fff;
  margin-top: 30px;
}
</style>
